<template>
	<view>
		<map class="map" :latitude="latitude" :longitude="longitude" :markers="markers"></map>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				longitude: '',
				latitude: '',
				markers:[
					{
						id:1,
						latitude: 123,
						longitude: 123,
						callout:{
							color:'#ffffff',
							content:'气泡内容',
							fontSize:16,
							borderRadius:5,
							bgColor:'#FF0000',
							padding:20,
							textAlign:'center',
							display:"ALWAYS"
						}
					}
				]
			};
		},
		onLoad() {
			const _this = this
			uni.getLocation({
			    type: 'wgs84',
			    success: function (res) {
			        _this.longitude = res.longitude
			        _this.latitude = res.latitude
					_this.markers[0] = {
						id:1,
						latitude: res.latitude,
						longitude: res.longitude,
						callout:{
							color:'#ffffff',
							content:'气泡内容123',
							fontSize:16,
							borderRadius:5,
							bgColor:'#FF0000',
							padding:20,
							textAlign:'center',
							display:"ALWAYS"
						}
					}
					console.log(_this.markers)
			    }
			});
		}
	}
</script>

<style lang="css" scoped>
.map {
	height: 100vh;
	width: 100vw;
}
</style>
